package mint.modules.generator.expression;

import java.util.Formatter;

import mint.modules.generator.MintNode;
import mint.modules.generator.Scope;
import mint.modules.symbol.Symbol;
import mint.modules.type.Type;

public abstract class Expression implements MintNode {
	private Scope parent;
	private ExpressionType expressionType;
	
	public Expression(Scope theParent, ExpressionType exprType)
	{
		parent = theParent;
		expressionType = exprType;		
	}
	
	public Symbol searchSymbol(String name)
	{
		return parent.searchSymbol(name, parent.getContainerClass(), false);
	}
	
	public ExpressionType getExpressionType()
	{
		return expressionType;
	}
	
	public String getInnerClass()
	{
		return parent.getContainerClass();
	}
	
	public abstract void leftEmit(Formatter output);
	
	public abstract Type getType();
}
